<%inherit file="/en/base.html" />
<%namespace file="/gmap.html" import="*"/>
<h3>${ctx.j.name|h,ctx.h.defnone}</h3>
% if ctx.errors:
<table>
% for k in ctx.msg.keys():
    <tr><td style="text:#FFAAAA"><b>${k}</b></td><td>${ctx.msg[k]}</td></tr>
% endfor
</table>
% endif
<br>
    % if ctx.j.public:
        Pub.&nbsp;
    % endif
 
    <p>
    % if ctx.j.started:
        Started on ${h.defnone(ctx.j.started)}
    % endif 
    % if ctx.j.ended:
        &nbsp; Finished on ${h.defnone(ctx.j.ended)}
    % endif
    </p>
    <p>
    % if ctx.j.length:
        Length ${ctx.j.length|ctx.h.defnone}
    % endif
    </p>
    <p>${ctx.j.desc|h,ctx.h.defnone,ctx.h.replws}</p>
    % if ctx.j.user == ctx.user:
        <a href="/myjourney/edit?journey=${str(ctx.j.key())}">&nbsp;Edit</a>
    % endif

<hr>
${journeypoly_gmapjs()|n}
${journeypoly_view()|n}
<%def name="bodyspec()">
 onload="journeypoly_initialize()" onunload="GUnload()"
</%def>
<hr>
    <strong>Way points</strong>
    <ol>
    % for wp in ctx.j.waypoints:
    
        <li> 
            <div id=wp>
                <div id=head style="border:1px solid #000000;background-color:#EEEEEE">
                    <% flag = False %>
                    % if wp.arrived:
                        Arrived: ${wp.arrived}&nbsp;
                        <% flag = True %>
                    %endif
                    %if wp.leaved:
                        Leaved:${wp.leaved}&nbsp;
                        <% flag = True %>
                    %endif
                    % if flag:
                        <br>
                    % endif
                    % if wp.coords:
                        Coordinates: ${wp.coords}
                    %endif
                    <span style="position:absolute;right:3px">
                    <a href="#" onclick="journeypoly_center(${wp.lat()},${wp.lng()});return false;">Center on map</a>
                    </span>
                </div>
                
                <p id=wpdesc style="margin:10px 5px;width:600px">${ctx.h.textcut( wp.desc, 100, "/waypoints/view?wp=%s&journey=%s" % ( wp.key(), ctx.j.key()) ) }</p>
             </div>   
        </li>
    
    % endfor
    </ol>

